<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<jsp:directive.page import="java.text.SimpleDateFormat" />
<jsp:directive.page import="java.text.DateFormat" />
<jsp:directive.page import="java.util.*" />
<%!DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");%>
<%
	int year = 0;
	int month = 0;
	int day = 0;
	int hour = 0;
	int minute = 0;
	int second = 0;
	Calendar c = Calendar.getInstance();//获得系统当前日期
	year = c.get(Calendar.YEAR);
	month = c.get(Calendar.MONTH) + 1;//系统日期从0开始算起
	day = c.get(Calendar.DAY_OF_MONTH);
	hour = c.get(Calendar.HOUR_OF_DAY);
	minute = c.get(Calendar.MINUTE);
	second = c.get(Calendar.SECOND);
	session.setAttribute("mytime", df.format(new Date()));
	session.setAttribute("username", "admin");
	session.setAttribute("logindate", year + "-" + month + "-" + (day<10?"0"+day:day) + " " + (hour<10?"0"+hour:hour) + ":" + (minute<10?"0"+minute:minute) + ":" + (second<10?"0"+second:second));
	response.sendRedirect("SessionOK.jsp");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Session 实例</title>
</head>
<body>

</body>
</html>